#ifndef SYNC_TASK_H
#define SYNC_TASK_H

#include "abstract_task.h"

namespace task
{
class SyncTask;
using SyncTaskConstPtr = std::shared_ptr<SyncTask>;
/**
 * @brief:  持续状态下的长任务
 * @author: sherlock_lht
 */
class SyncTask: public AbstractTask
{
public:
    explicit SyncTask(const std::string &name)
        : AbstractTask(name)
    {
    }
    ~SyncTask()
    {
    }

    bool onStart() override = 0;

    TaskStatus onRunning() override = 0;

    bool onPause() override = 0;

    bool onResume() override = 0;

    void onCancel() override = 0;

    TaskType getTaskType() const final
    {
        return SYNC_TASK;
    }
};
}

#endif //SYNC_TASK_H
